package com.wx.mapper;

import com.wx.common.MyMapper;
import com.wx.domain.dto.BatchDeleteDto;
import com.wx.domain.dto.PermissionDto;
import com.wx.entity.SysAuthority;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * The interface Authority mapper.
 */
@Mapper
@Component
public interface SysAuthorityMapper extends MyMapper<SysAuthority> {

    /**
     * <p>Title:     getOwnAuthority. </p>
     * <p>Description 根据userId查询权限信息</p>
     *
     * @param userId the user id
     * @return own authority
     * @Author <a href="xinglinglove1029@163.com"/>杨文生</a>
     * @since 2018 /4/27 10:22
     */
    List<SysAuthority> getOwnAuthority(String userId);

    /**
     * <p>Title:     queryListPage. </p>
     * <p>Description 分页查询权限信息</p>
     *
     * @param sysAuthority the authority
     * @return list list
     * @Author <a href="xinglinglove1029@163.com"/>杨文生</a>
     * @since 2018 /4/27 10:21
     */
    List<SysAuthority> queryListPage(SysAuthority sysAuthority);

    /**
     * <p>Title:      getBindPermissionByRoleIds. </p>
     * <p>Description 根据角色Id查询权限信息</p>
     *
     * @param        roleIds List<String>
     * @return      List<Authority>
     * @Author        <a href="xinglinglove1029@163.com"/>杨文生</a>
     * @since     2019/4/25 19:20
     */
    List<SysAuthority> getBindPermissionByRoleIds(@Param("roleIds") List<String> roleIds);

    /**
     * <p>Title:      findAllPermission. </p>
     * <p>Description 查询所有权限</p>
     *
     * @return        List<PermissionDto>
     * @Author        <a href="xinglinglove1029@163.com"/>杨文生</a>
     * @since     2019/8/12 21:42
     */
    List<PermissionDto> findAllPermission();

    List<SysAuthority> selectAllMenu();

    int batchDeleteResource(BatchDeleteDto batchDeleteDto);

    List<SysAuthority> batchQuery(@Param("idList") List<String> idList);

    List<String> getOwnPermissionByRoleIds(@Param("roleIds") List<String> roleIdList);
}